
#include <iostream>
#include <boost/thread.hpp>


void Fun(int k) {
    while (true) {
        std::cout << __FUNCTION__ << " " << k << std::endl;
        boost::this_thread::sleep(boost::posix_time::seconds(1));
    }
}

class foo_c {
public:
    foo_c() {}

    ~foo_c() {}

public:
    void FooFun(int m) {
        while (true) {
            std::cout << __FUNCTION__ << " " << m << std::endl;
            boost::this_thread::sleep(boost::posix_time::seconds(1));
        }
    }
};


int main() {

    boost::thread t(Fun, 88);

    foo_c foo;

    boost::thread t2(&foo_c::FooFun, &foo, 99);

    while (true) {
        std::cout << __FUNCTION__ << std::endl;
        boost::this_thread::sleep(boost::posix_time::seconds(1));
    }
    t.join();
}